﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ThemeWedding.aspx.cs" Inherits="HQWeb.SysManage.ThemeWeddingManage.ThemeWedding" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Styles/GridViewStyle.css" rel="Stylesheet" type="text/css" />
    <link href="../../Styles/Site.css" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">

        //var dialogboxUrl = "../../DialogBox.aspx";

        //文件配置
        function AddFile() {
            var rtnValue, url, title, feature;
            var varPID = document.getElementById("hidID").value;
            //            if (varPID == "") {
            //                alert("请先保存作业配置基本信息");
            //                return;
            //            }
            var url = "../../Resources/FileList/FileFrame.htm?type=add&id=" + varPID + "&ronth=" + Math.round();
            var feature = "dialogWidth:600px;dialogHeight:650px;center:yes;help:no;resizable:yes;status:no;scroll:no";
            //var title = "添加 文件配置";
            //var varReturn = showDialogBox(dialogboxUrl, url, title, feature);
            var varReturn = window.showModalDialog(url, '', feature);
            if (varReturn != null) {
                document.getElementById("btnGetFile").click();
                //                document.getElementById("totalPerson").innerHTML = arry[0];
                //                document.getElementById("totalDay").innerHTML = arry[1];
            }
        }


        //项目配置
        function AddProject() {
            var rtnValue, url, title, feature;
            var varPID = document.getElementById("hidID").value;
            //            if (varPID == "") {
            //                alert("请先保存作业配置基本信息");
            //                return;
            //            }
            var url = "../../Resources/ProjectList/ProjectFrame.htm?type=add&id=" + varPID + "&ronth=" + Math.round();
            var feature = "dialogWidth:1000px;dialogHeight:600px;center:yes;help:no;resizable:yes;status:no;scroll:no";
            var title = "添加 文件配置";
            //var varReturn = showDialogBox(dialogboxUrl, url, title, feature);
            var varReturn = window.showModalDialog(url, '', feature);
            if (varReturn != null) {
                document.getElementById("btnGetProject").click();
            }
        }
        //        function editFile(id) {
        //            var rtnValue, url, title, feature;
        //            var varPID = document.getElementById("hidID").value;
        //            //            if (varPID == "") {
        //            //                alert("请先保存作业配置基本信息");
        //            //                return;
        //            //            }
        //            var url = "Resources/ProjectList/ProjectFrame.htm?type=edit&id=" + id + "&ronth=" + Math.round();
        //            var feature = "dialogWidth:630px;dialogHeight:500px;center:yes;help:no;resizable:yes;status:no;scroll:no";
        //            var title = "添加 文件配置";
        //            var varReturn = showDialogBox(dialogboxUrl, url, title, feature);
        //            if (varReturn != null) {
        //                document.getElementById("btnGetProjectdeail").click();
        //                //                document.getElementById("totalPerson").innerHTML = arry[0];
        //                //                document.getElementById("totalDay").innerHTML = arry[1];
        //            }

        //        }

        function delFileData(obj) {
            if (confirm("是否删除记录？")) {
                document.getElementById("delFileID").value = obj;
                document.getElementById("btnDELFile").click();
            }
        }

        function delProjectData(obj) {
            if (confirm("是否删除记录？")) {
                document.getElementById("delProjectID").value = obj;
                document.getElementById("btnDELProject").click();
            }
        }

        function add(objid) {

            document.getElementById("NumProjectID").value = objid;
            document.getElementById("addNum").click();

        }

        function subtract(objid, objnum) {
            if (parseInt(objnum) > 1) {
                document.getElementById("NumProjectID").value = objid;
                document.getElementById("subtractNum").click();
            }
            else {
                alert("项目数量不能为：0");
            }
        }

        function bindstyle(str) {
            if (str != null && str != "") {
                var newschool = str.split(',');
                for (var i in newschool) {
                    var checkstyle = "w" + newschool[i];
                    var style = document.getElementById(checkstyle);
                    if (style != null && style != undefined) {
                        style.checked = true;
                    }
                }
            }
        }

        function AddData() {
            var els = document.getElementsByName("wstyle");
            var weddingStyle = document.getElementById("hidWeddingStyle").value;
            for (var i = 0; i < els.length; i++) {
                if (els[i].tagName.toLowerCase() == "input" && els[i].type == "checkbox" && els[i].checked == true) {
                    var attribute = els[i].getAttribute("value");
                    if (weddingStyle != null && weddingStyle != "") {
                        weddingStyle = weddingStyle + attribute + ",";
                    }
                    else {
                        weddingStyle = "," + attribute + ",";
                    }
                }
            }
            document.getElementById("hidWeddingStyle").value = weddingStyle;
            document.getElementById("btn_Add").click();
        }

        function addhotel() {
            var str = window.showModalDialog("../../Resources/HotelList/HotelFrame.htm", " ", "dialogWidth=800px;dialogHeight=400px");
            if (str != undefined) {
                document.getElementById("<%=wedding_hotel.ClientID%>").value = str;
            }
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <table width="98%">
            <tr>
                <td colspan="4" class="title">
                    <asp:Label runat="server" ID="labTitle" Text="主题庆典"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%">
                    主 题 ：
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtName" Width="205px"></asp:TextBox><span style="color: Red">*</span><asp:RequiredFieldValidator
                        runat="server" ID="rev_Num" ControlToValidate="txtName" ForeColor="Red" ErrorMessage="请您输入主题！"
                        Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
                <td>
                    庆典类型：
                </td>
                <td>
                    <asp:DropDownList runat="server" ID="dropType">
                    </asp:DropDownList>
                </td>
                <%--    <td colspan="2">
                    &nbsp;
                </td> --%>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    风 格：
                </td>
                <td colspan="3" id="addStyle" runat="server">
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    色 彩：
                </td>
                <td>
                    <asp:DropDownList ID="drop_color" Width="88px" runat="server">
                    </asp:DropDownList>
                </td>
                <td align="right" style="width: 20%;">
                    庆典预算：
                </td>
                <td>
                    <asp:DropDownList ID="drop_price" Width="88px" runat="server">
                    </asp:DropDownList>
                    <%-- <asp:TextBox runat="server" ID="txtprice"></asp:TextBox><span style="color: Red">*</span>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="只能是整数" ControlToValidate="txtprice"
                        MaximumValue="999999999" MinimumValue="0" ForeColor="Red" Type="Integer"></asp:RangeValidator>--%>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    月 份：
                </td>
                <td>
                    <asp:DropDownList ID="wending_month" Width="88px" runat="server">
                    </asp:DropDownList>
                </td>
                <td align="right" style="width: 20%;">
                    酒店名称：
                </td>
                <td colspan="2">
                    <asp:TextBox runat="server" ID="wedding_hotel"></asp:TextBox>&nbsp;&nbsp;<input type="button"
                        id="hotelselect" onclick="addhotel()" value="选择" />
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    其他资料文件夹：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtFileUrl" runat="server"></asp:TextBox><span style="color: Red">此文件夹必须创建在nas服务器上的"主题婚礼"文件夹下，不填默认文件夹名称是主题婚礼标题</span>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    描 述：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtDescription" Width="70%" runat="server" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="4" align="center">
                    <%--<asp:Button ID="btn_Add" runat="server" Text="保 存" Width="61px" CommandName="add"
                    OnClick="btn_Add_Click" />--%>
                    <input type="button" id="Add" value="保 存" onclick="AddData()" />
                    <input type="button" id="btn_back" value="返 回" onclick="javascript:location='ThemeWeddingList.aspx'" />
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    主题婚礼文件
                </td>
                <td colspan="3">
                    &nbsp;&nbsp;&nbsp;<input type="button" id="btnAdd" value="添 加" onclick="AddFile()" />&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="4" align="center">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:Repeater ID="repeater1" runat="Server">
                                <HeaderTemplate>
                                    <table id="dtUser" class="datalist" bordercolor="#737373" border="1" style="width: 88%;
                                        border-collapse: collapse;">
                                        <thead>
                                            <tr style="background-color: #CAE2EB; height: 26px; text-align: center">
                                                <td style="width: 10%; text-align: center;">
                                                    序号</th>
                                                    <td style="width: 30%; text-align: center;">
                                                        文件标题
                                                    </td>
                                                    <td style="width: 15%; text-align: center;">
                                                        文件类型
                                                    </td>
                                                    <%--<td style="width: 20%; text-align: center;">
                                                        上传时间
                                                    </td>--%>
                                                    <td style="width: 10%; text-align: center;">
                                                        状 态
                                                    </td>
                                                    <td style="width: 15%; text-align: center;">
                                                        操作
                                                    </td>
                                            </tr>
                                        </thead>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr style="background-color: #FFFFFF;">
                                        <td style="background-color: #CAE2EB; text-align: center">
                                            <%# (int)DataBinder.Eval(Container, "ItemIndex") + 1%>
                                        </td>
                                        <td style="text-align: center">
                                            <%#DataBinder.Eval(Container.DataItem, "FILE_TITEL")%>
                                        </td>
                                        <td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "TYPE").ToString().Equals("0") ? "图片" : "视频"%>
                                        </td>
                                        <%--<td style="text-align: center">
                                            <%#DataBinder.Eval(Container.DataItem, "UPTIME")%>
                                        </td>--%>
                                        <td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "ISFLAG").ToString().Equals("False") ? "未设定" : "已设定"%>
                                        </td>
                                        <td style="text-align: center">
                                            <%--<a href="javascript:void(0)" style="color: Blue" onclick="return edit('<%# DataBinder.Eval(Container.DataItem,"FILE_ID") %>')">
                                    修改</a>--%>
                                            <a href="javascript:void(0)" style="color: Blue" onclick="return delFileData('<%# DataBinder.Eval(Container.DataItem,"FILE_ID") %>')">
                                                删除</a> <a href="javascript:void(0)" style="color: Blue" onclick="return delFileData('<%# DataBinder.Eval(Container.DataItem,"FILE_ID") %>')">
                                                    上移</a>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <AlternatingItemTemplate>
                                    <tr style="background-color: #FAFAF9;">
                                        <td style="background-color: #CAE2EB; text-align: center">
                                            <%# (int)DataBinder.Eval(Container, "ItemIndex") + 1%>
                                        </td>
                                        <td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "FILE_TITEL")%>
                                        </td>
                                        <td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "TYPE").ToString().Equals("0") ? "图片" : "视频"%>
                                        </td>
                                        <%--<td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "UPTIME")%>
                                        </td>--%>
                                        <td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "ISFLAG").ToString().Equals("0") ? "未设定" : "已设定"%>
                                        </td>
                                        <td style="text-align: center">
                                            <%-- <a href="javascript:void(0)" style="color: Blue" onclick="return edit('<%# DataBinder.Eval(Container.DataItem,"FILE_ID") %>')">
                                    修改</a>--%>
                                            <a href="javascript:void(0)" style="color: Blue" onclick="return delFileData('<%# DataBinder.Eval(Container.DataItem,"FILE_ID") %>')">
                                                删除</a> <a href="javascript:void(0)" style="color: Blue" onclick="return delFileData('<%# DataBinder.Eval(Container.DataItem,"FILE_ID") %>')">
                                                    上移</a>
                                        </td>
                                    </tr>
                                </AlternatingItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                            </asp:Repeater>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnGetFile" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="btnDELFile" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    主题婚礼项目
                </td>
                <td colspan="3">
                    &nbsp;&nbsp;&nbsp;<input type="button" id="btn_project" value="添 加" onclick="AddProject()" />&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="4" align="center">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                        <ContentTemplate>
                            <asp:Repeater ID="repeater2" runat="Server">
                                <HeaderTemplate>
                                    <table id="dtUser" class="datalist" bordercolor="#737373" border="1" style="width: 88%;
                                        border-collapse: collapse;">
                                        <thead>
                                            <tr style="background-color: #CAE2EB; height: 26px; text-align: center">
                                                <td style="width: 10%; text-align: center;">
                                                    序号</th>
                                                    <td style="width: 25%; text-align: center;">
                                                        项目名称
                                                    </td>
                                                    <td style="width: 15%; text-align: center;">
                                                        价格
                                                    </td>
                                                    <td style="width: 27%; text-align: center;">
                                                        数量
                                                    </td>
                                                    <td style="width: 8%; text-align: center;">
                                                        操作
                                                    </td>
                                            </tr>
                                        </thead>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr style="background-color: #FFFFFF;">
                                        <td style="background-color: #CAE2EB; text-align: center">
                                            <%# (int)DataBinder.Eval(Container, "ItemIndex") + 1%>
                                        </td>
                                        <td style="text-align: center">
                                            <%#DataBinder.Eval(Container.DataItem, "PROJECT_NAME")%>
                                        </td>
                                        <td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "PRICE")%>
                                        </td>
                                        <td style="text-align: center">
                                            <%-- <div id="<%# (int)DataBinder.Eval(Container, "ItemIndex") + 1%>"><%# DataBinder.Eval(Container.DataItem, "Number")%></div>--%>
                                            <input type="button" onclick="add('<%# DataBinder.Eval(Container.DataItem,"ProjectID") %>')"
                                                id="jia" value="+" />
                                            <%# DataBinder.Eval(Container.DataItem, "Number")%>
                                            <input type="button" id="jian" onclick="subtract('<%# DataBinder.Eval(Container.DataItem,"ProjectID") %>', '<%# DataBinder.Eval(Container.DataItem, "Number")%>')"
                                                value="-" />
                                        </td>
                                        <%--<td style="text-align: center">
                                            <%#DataBinder.Eval(Container.DataItem, "REMARK")%>
                                        </td>--%>
                                        <td style="text-align: center">
                                            <%--<a href="javascript:void(0)" style="color: Blue" onclick="return edit('<%# DataBinder.Eval(Container.DataItem,"PROJECT_ID") %>')">
                                    修改</a>--%>
                                            <a href="javascript:void(0)" style="color: Blue" onclick="return delProjectData('<%# DataBinder.Eval(Container.DataItem,"ProjectID") %>')">
                                                删除</a>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <AlternatingItemTemplate>
                                    <tr style="background-color: #FAFAF9;">
                                        <td style="background-color: #CAE2EB; text-align: center">
                                            <%# (int)DataBinder.Eval(Container, "ItemIndex") + 1%>
                                        </td>
                                        <td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "PROJECT_NAME")%>
                                        </td>
                                        <td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "PRICE")%>
                                        </td>
                                        <td style="text-align: center">
                                            <%--<div id="<%# (int)DataBinder.Eval(Container, "ItemIndex") + 1%>"><%# DataBinder.Eval(Container.DataItem, "Number")%></div>--%>
                                            <input type="button" onclick="add('<%# DataBinder.Eval(Container.DataItem,"ProjectID") %>')"
                                                id="jia" value="+" />
                                            <%# DataBinder.Eval(Container.DataItem, "Number")%>
                                            <input type="button" id="jian" onclick="subtract('<%# DataBinder.Eval(Container.DataItem,"ProjectID")%>', '<%# DataBinder.Eval(Container.DataItem, "Number")%>')"
                                                value="-" />
                                        </td>
                                        <%--<td style="text-align: center">
                                            <%# DataBinder.Eval(Container.DataItem, "REMARK")%>
                                        </td>--%>
                                        <td style="text-align: center">
                                            <%--<a href="javascript:void(0)" style="color: Blue" onclick="return edit('<%# DataBinder.Eval(Container.DataItem,"PROJECT_ID") %>')">
                                    修改</a>--%>
                                            <a href="javascript:void(0)" style="color: Blue" onclick="return delProjectData('<%# DataBinder.Eval(Container.DataItem,"ProjectID") %>')">
                                                删除</a>
                                        </td>
                                    </tr>
                                </AlternatingItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                            </asp:Repeater>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnGetProject" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="btnDELProject" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="addNum" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="subtractNum" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </td>
            </tr>
        </table>
        <div style="display: none">
            <asp:HiddenField ID="delFileID" runat="server" />
            <asp:Button ID="btnGetFile" runat="server" Text="Button" OnClick="btnGetFile_Click" />
            <%-- 保存主表ID--%>
            <asp:Button ID="btnDELFile" runat="server" Text="Button" OnClick="btnDELFile_Click" />
            <%--  执行删除事件--%>
        </div>
        <div style="display: none">
            <asp:HiddenField ID="hidWeddingStyle" runat="server" />
            <asp:HiddenField ID="hidID" runat="server" />
            <asp:HiddenField ID="delProjectID" runat="server" />
            <asp:HiddenField ID="NumProjectID" runat="server" />
            <asp:HiddenField ID="hidUpID" runat="server" />
            <asp:Button ID="btnGetProject" runat="server" Text="Button" OnClick="btnGetProject_Click" />
            <%-- 保存主表ID--%>
            <asp:Button ID="btnDELProject" runat="server" Text="Button" OnClick="btnDELProject_Click" />
            <%--  执行删除事件--%>
            <asp:Button ID="addNum" runat="server" Text="Button" OnClick="btnaddNum_Click" />
            <asp:Button ID="subtractNum" runat="server" Text="Button" OnClick="btnsubtractNum_Click" />
            <asp:Button ID="btn_Add" runat="server" CommandName="add" OnClick="btn_Add_Click" />
        </div>
    </div>
    </form>
</body>
</html>
